<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Article extends Model
{
    protected $table = 'article';
    public $timestamps = true;
    protected $dateFormat = 'U';


    public static function getDetailById($id){
      $res = self::where('id',$id)->first();
      $res1 = [];
      $res1['created_at'] = date('Y-m-d');
      $res1['post_author'] = $res['post_author'];
      $res1['post_content'] = $res['post_content'];
      $res1['post_title'] = $res['post_title'];
      $res1['cov_pic'] = $res['cov_pic'];
      return $res1;
    }
}
